# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Eric Bélanger <eric@archlinux.org>

pkgname=gpac
pkgver=2.2.1
pkgrel=2
epoch=1
pkgdesc='A multimedia framework based on the MPEG-4 Systems standard'
arch=(loong64 x86_64)
url=https://gpac.wp.imt.fr/
license=(LGPL)
depends=(
  glibc
  libnghttp2
  openssl
  xz
  zlib
)
makedepends=(git)
optdepends=('python: python bindings')
provides=(libgpac.so)
_tag=b34e3851670f4398a4e2efcb86b30a8b07743212
source=(git+https://github.com/gpac/gpac.git#tag=${_tag})
b2sums=(SKIP)

pkgver() {
  cd gpac
  git describe --tags | sed 's/^v//'
}

build() {
  export CFLAGS+=" -ffat-lto-objects"
  export CXXFLAGS+=" -ffat-lto-objects"
  cd gpac
  ./configure \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --disable-oss-audio \
    --disable-dvb4linux \
    --disable-qjs \
    --enable-pic
  make
}

package() {
  make DESTDIR="${pkgdir}" STRIP=true -C gpac install
  make DESTDIR="${pkgdir}" STRIP=true -C gpac install-lib
}

# vim: ts=2 sw=2 et:
